package com.cpfmat.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.cpfmat.entity.SystemMenu;
import com.cpfmat.mapper.SystemMenuMapper;
import com.cpfmat.service.ISystemMenuService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhangbin
 * @since 2018-07-30
 */
@Service
public class SystemMenuServiceImpl extends ServiceImpl<SystemMenuMapper, SystemMenu> implements ISystemMenuService {
	@Autowired
	private SystemMenuMapper systemMenuMapper;

	@Override
	public List<SystemMenu> getListByParent(String key, String seqId) {
		if(StringUtils.isNotBlank(key) || StringUtils.isNotBlank(seqId)){
			Map<String,String> param = new HashMap<String,String>();
			
			if(StringUtils.isNotBlank(key)){
				param.put("key", key);
			}
			
			if(StringUtils.isNotBlank(seqId)){
				param.put("seqId", seqId);
			}
			return systemMenuMapper.getListByParent(param);
		}
		else{
			return null;
		}
		
	}

}
